﻿<%@ Page Language="vb" AutoEventWireup="false"  CodeFile="ProcessDocumentViewPopupForm.aspx.vb" Inherits="InSiteWebApplication.ProcessDocumentViewPopupForm" %>
<%@ Register Src="~/uMESCustomControls/pageTurning/pageTurning.ascx" TagName="pageTurning"
    TagPrefix="uPT" %>
<%@ Register Src="~/uMESCustomControls/ProductInfo/GetProductInfo.ascx" TagName="getProductInfo"
    TagPrefix="gPI" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
	<title>文档查看</title>
	<base target="_self" />
	<script src="/InSiteWebApplication/Scripts/jquery-1.11.2.min.js" type="text/javascript"></script>
	<style type="text/css">
		.astyle {
			font-size: 12px !important;
			height: 10px !important;
			text-align: center !important;
			color: Blue !important;
		}
	</style>
	<script language="javascript" type="text/javascript">
		function getIp() {
			var curWwwPath = window.document.location.href;
			var pathName = window.document.location.pathname;
			var pos = curWwwPath.indexOf(pathName);
			//获取主机地址，如： http://localhost:8083
			var localhostPaht = curWwwPath.substring(0, pos);
			return localhostPaht;
		}
		//判断文件是否存在
		function isExistFile(url) {
			jQuery.support.cors = true;
			var result = false;
			jQuery.support.cors = true;
			$.ajax({
				type: "Get",
				url: url,
				cashe: false,
				async: false,
				xhrFields: {
					withCredentials: true
				}, //跨域带cookie
				crossDomain: true,
				beforeSend: function() {

				},
				success: function(data) {
					result = true;
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					//alert(XMLHttpRequest.responseText);
				}

			});
			return result;
		}

		function openDocUrl_1(url) {
		    //var ip = "10.15.7.75";
		    //var url = "http://" + ip + "/InSiteWebApplication/" + encodeURIComponent(value);
		    //if (isExistFile(url) == false) {
		    //	ip = "10.15.7.76";
		    //	url = "http://" + ip + "/InSiteWebApplication/" + encodeURIComponent(value);
		    //	if (isExistFile(url) == false) {
		    //		ip = getIp();
		    //		url = ip + "/InSiteWebApplication/" + encodeURIComponent(value);
		    //	}
		    //}
		    //window.open(url);
		    //prompt(webSite, url);
		    //webSite = "http://10.15.7.76/InSiteWebApplication/";
		    //url = "Temp/#Fng#yoRiEWCPGzlWEWOsQ/00708904-01.pdf";
		    //prompt("",webSite + encodeURIComponent(url));
		    if (url) {
		        window.open(url)
		    } else {
		        alert("文件不存在")
		        return
		    }
		}

		function openDocUrl(url) {
		    var url = url;
		    var objShell = new ActiveXObject("WScript.Shell");
		    var cmd = 'cmd.exe /c start chrome " ' + url;
		    try {
		        objShell.Run(cmd, 0, true);
		    } catch (e) {
		        alert("请在IE中将 http://10.15.7.76 和 http://10.15.7.75 加入可信站点！");
		    }
		}

		function keepSrollBar() {
			var scrollPos;
			if (typeof window.pageYoffset != 'undefined') {
				scrollPos = window.pageYoffset;
			} else if (typeof document.body != 'undefined') {
				scrollPos = document.getElementById('tvTree').scrollTop;
			}
			document.cookie = "scrollTop=" + scrollPos;
		}
		window.onload = function() {
			if (document.cookie.match(/scrollTop=([^;]+)(;|$)/) != null) {
				var arr = document.cookie.match(/scrollTop=([^;]+)(;|$)/);
				document.getElementById('tvTree').scrollTop = parseInt(arr[1]);
				//将cookie设置为失效
				var date = new Date();
				date.setTime(date.getTime() + 1); //失效时间为1毫秒
				document.cookie = "scrollTop=" + parseInt(arr[1]) + ";expires=" + date.toGMTString();
			}
		}
	</script>
</head>
<!-- Caution: modifying the id and runat attributes of the body will affect the integrity of the application. -->

<body class="FormBody" id="bodyControl" runat="server">
	<!-- Caution: modifying the id and runat attributes of the form will affect the integrity of the application. -->
	<form id="formControl" method="post" runat="server">
		<div style="width: 99%;height:470px; margin: 3px 0px 3px 3px; position: relative;">
			<div style="position: relative; float: left;display:none">
				<gPI:getProductInfo ID="getProductInfo" runat="server" />
			</div>
			<div style="float:left;Width:300px;Height:100%;">
				<asp:Label ID="Label1" runat="server" Text="产品工艺工序"></asp:Label>
				<div style="position:relative ;float:left;">
					<asp:TreeView ID="tvTree" runat="server" Height="470px" Width="100%" ShowLines="True" BorderWidth="1px" Style="z-index: 100; left: 0px; position: relative; top: 0px;overflow:auto 
                        " NodeWrap="True" BorderStyle="Notset">
					</asp:TreeView>
				</div>
				<div style="clear:both"></div>
				<div style="width:300px;text-align: left; position: relative; left: 0px;top:0px;display:none;">
					<uPT:pageTurning ID="upageTurning" runat="server" />
				</div>
			</div>
			<div style="float:left;margin-left:10px;width:350px;height:470px">
				<asp:Label ID="Label2" runat="server" Text="文档信息"></asp:Label>
				<fbg:WebGrid ID="wgDoc" runat="server" ColumnLabelsType="Default" Height="100%" LabelsType="Designer" RowsPerPage="6" Width="100%">
					<Bands>
						<igtbl:UltraGridBand>
							<columns>
								<igtbl:UltraGridColumn BaseColumnName="documentname" key="DocumentName" headerText="文档名称" width="200px">
								</igtbl:UltraGridColumn>
								<igtbl:UltraGridColumn BaseColumnName="filepath" key="FilePath" headerText="文档地址" width="120px" hidden="true">
								</igtbl:UltraGridColumn>
								<igtbl:UltraGridColumn BaseColumnName="type" key="Type" headerText="文档存储类型" width="120px" hidden="true">
								</igtbl:UltraGridColumn>
								<igtbl:UltraGridColumn BaseColumnName="" key="BtnDoc" Type="Button" nulltext="查看文档" headerText="查看文档" width="80px" CellButtonDisplay="Always">
									<cellbuttonstyle cursor="Hand"></cellbuttonstyle>
								</igtbl:UltraGridColumn>
							</columns>
							<addnewrow visible="NotSet" view="NotSet"></addnewrow>
						</igtbl:UltraGridBand>
					</Bands>
					<DisplayLayout BorderCollapseDefault="Separate" Name="wgContainerInfo" OptimizeCSSClassNamesOutput="False" RowHeightDefault="24px" StationaryMargins="Header" TableLayout="Fixed" Version="4.00" AllowSortingDefault="OnClient" AutoGenerateColumns="False" CellClickActionDefault="CellSelect" SelectTypeRowDefault="Single" AllowColSizingDefault="Free" HeaderClickActionDefault="SortSingle">
						<FrameStyle BorderColor="#A5ACB2" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="8pt" Height="100%" Width="100%">
						</FrameStyle>
						<RowAlternateStyleDefault BackColor="#86DFD9" CssClass="GridRowAlternateStyle">
							<Padding Left="0px"></Padding>
						</RowAlternateStyleDefault>

						<ClientSideEvents InitializeLayoutHandler="OnInitializeLayoutHandler(), OnInitializeLayoutHandler(), OnInitializeLayoutHandler(), OnInitializeLayoutHandler(), OnInitializeLayoutHandler"></ClientSideEvents>

						<Pager PageSize="6">
							<PagerStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
								<BorderDetails ColorLeft="White" ColorTop="White"></BorderDetails>
							</PagerStyle>
						</Pager>
						<EditCellStyleDefault BorderStyle="None" BorderWidth="0px" CssClass="GridEditCellStyle">
						</EditCellStyleDefault>
						<HeaderStyleDefault BackColor="LightGray" BorderStyle="Solid" CssClass="GridHeaderStyle" Height="100%" Wrap="True">
							<Padding Top="2px" Bottom="3px"></Padding>
							<BorderDetails ColorLeft="White" ColorTop="White"></BorderDetails>
						</HeaderStyleDefault>
						<RowSelectorStyleDefault>
							<Padding Left="0px"></Padding>
						</RowSelectorStyleDefault>
						<RowStyleDefault BackColor="White" BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" CssClass="GridRowStyle" Font-Names="Verdana" Font-Size="8pt">
							<Padding Left="3px"></Padding>
							<BorderDetails ColorLeft="White" ColorTop="White"></BorderDetails>
						</RowStyleDefault>
						<SelectedRowStyleDefault CssClass="GridSelectedRowStyle">
						</SelectedRowStyleDefault>
						<AddNewBox>
							<BoxStyle BackColor="LightGray" BorderStyle="Solid" BorderWidth="1px">
								<BorderDetails ColorLeft="White" ColorTop="White"></BorderDetails>
							</BoxStyle>
						</AddNewBox>
						<ActivationObject BorderColor="" BorderWidth="">
						</ActivationObject>
					</DisplayLayout>
				</fbg:WebGrid>
			</div>
		</div>
		<fb:button id="CloseButton" style="Z-INDEX: 102;position: relative;left:270px;top:30px" runat="server" Width="72px" Text="关闭" DisplayInFrame="False"></fb:button>
		<asp:Label ID="StatusMessage" Style="z-index: 103;float:left; left: 0px; position: relative;top:10px" runat="server" Width="480px" Height="16px" Text=""></asp:Label>
	</form>
</body>

</html>